/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.thienloc.omap.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author GiangLT
 */
@Entity
@Table(name = "DOI_BONG", catalog = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "DoiBong.findAll", query = "SELECT d FROM DoiBong d"),
    @NamedQuery(name = "DoiBong.findById", query = "SELECT d FROM DoiBong d WHERE d.id = :id"),
    @NamedQuery(name = "DoiBong.findByTenDoi", query = "SELECT d FROM DoiBong d WHERE d.tenDoi = :tenDoi"),
    @NamedQuery(name = "DoiBong.findByMaDoi", query = "SELECT d FROM DoiBong d WHERE d.maDoi = :maDoi")})
public class DoiBong implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID")
    private Long id;
    @Size(max = 100)
    @Column(name = "TEN_DOI")
    private String tenDoi;
    @Size(max = 30)
    @Column(name = "MA_DOI")
    private String maDoi;

    public DoiBong() {
    }

    public DoiBong(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getTenDoi() {
        return tenDoi;
    }

    public void setTenDoi(String tenDoi) {
        this.tenDoi = tenDoi;
    }

    public String getMaDoi() {
        return maDoi;
    }

    public void setMaDoi(String maDoi) {
        this.maDoi = maDoi;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof DoiBong)) {
            return false;
        }
        DoiBong other = (DoiBong) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.thienloc.omap.entity.DoiBong[ id=" + id + " ]";
    }
    
}
